package com.huangliusong.threadcurrency.example.singleton;

import com.huangliusong.threadcurrency.annotation.NotThreadSafe;

/**
 * 懒汉模式
 * @author huangliusong
 * @since 2018/11/19
 * {@link }
 */
@NotThreadSafe
public class SingletonExample1 {
    private SingletonExample1(){

    }

    private static SingletonExample1 instance=null;

    public  static SingletonExample1 getInstane(){
        if (instance==null){
            instance=new SingletonExample1();
        }

        return instance;

    }
}
